package com.example.demo;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloWorld {
	
	@Autowired
	private Resource resource;
	
	@GetMapping ("hello")
	public Result hello() {
		User user = new User();
		user.setName(resource.getUser());
		user.setAge(resource.getAge());
		user.setBirthday(new Date());
	
		return Result.ok(user);
	}
	
}
